#pragma once
#include <so_math.h>
#include <list>
#include <vector>
#include <Vector2.h>
#include <assert.h>
class Circle;
class Rectangle;
class Shape2D
{
protected:

public:
};

class Circle : public Shape2D
{
protected:
    real radius;

public:
    Circle() = default;
    Circle(real radius);
    real getRadius() const;
    void setRadius(real radius);
};

class Rectangle : public Shape2D
{
protected:
    Vector2 size;

public:
    Rectangle() = default;
    Rectangle(const Vector2& size);
    Vector2 getSize() const;
    void setSize(const Vector2& size);
};

class Triangle : public Shape2D
{
private:
protected:
    Vector2 p[3];
    Vector2 circleCenter; //外接圆圆心
    Vector2 center;
    real r2;//外接圆半径平方
public:
    Triangle() = default;
    Triangle(Vector2 p1,Vector2 p2,Vector2 p3);
    const Vector2* getPoints() const;
    Vector2 getCircleCenter() const;
    Vector2 getCenter() const;
    real getRadius2() const;
};

class Polygon : public Shape2D
{
protected:
    std::vector<Vector2> plist;
public:
    Polygon() = default;
    Polygon(Vector2 *ps, int size);
    const std::vector<Vector2> getPoints() const;
};